import unittest
from veri.chkrs import Checker
from pispecs import *
    
    
class TestNetTranslator(unittest.TestCase):
    def setUp(self):
        self.checker = Checker()
        
    
    def test_AtomicTransitions(self):
        self.assertEqual(self.checker.check(Mono),              True)
        self.assertEqual(self.checker.check(Spaw),              True)
        self.assertEqual(self.checker.check(Term),              True)
        self.assertEqual(self.checker.check(Norm),              True)
    
    
    def test_Sync_Mono_Mono(self):
        self.assertEqual(self.checker.check(Mono_Mono_1),       True)
        self.assertEqual(self.checker.check(Mono_Mono_2),       True)
    
    def test_Sync_Mono_Spwn(self):
        self.assertEqual(self.checker.check(Mono_Spaw_1),       True)
        self.assertEqual(self.checker.check(Mono_Spaw_2),       True)
        
    def test_Sync_Mono_Term(self):
        self.assertEqual(self.checker.check(Mono_Term_1),       True)
        self.assertEqual(self.checker.check(Mono_Term_2),       True)
        
    def test_Sync_Mono_Norm(self):
        self.assertEqual(self.checker.check(Mono_Norm_1),       True)
        self.assertEqual(self.checker.check(Mono_Norm_2),       True)
        
    def test_Sync_Spwn_Mono(self):
        self.assertEqual(self.checker.check(Spaw_Mono_1),       True)
        self.assertEqual(self.checker.check(Spaw_Mono_2),       True)
        
    def test_Sync_Spwn_Spwn(self):
        self.assertEqual(self.checker.check(Spaw_Spaw_1),       True)
        self.assertEqual(self.checker.check(Spaw_Spaw_2),       True)
        
    def test_Sync_Spwn_Term(self):
        self.assertEqual(self.checker.check(Spaw_Term_1),       True)
        self.assertEqual(self.checker.check(Spaw_Term_2),       True)
        
    def test_Sync_Spwn_Norm(self):
        self.assertEqual(self.checker.check(Spaw_Norm_1),       True)
        self.assertEqual(self.checker.check(Spaw_Norm_2),       True)
        
    def test_Sync_Term_Mono(self):
        self.assertEqual(self.checker.check(Term_Mono_1),       True)
        self.assertEqual(self.checker.check(Term_Mono_2),       True)
        
    def test_Sync_Term_Spwn(self):
        self.assertEqual(self.checker.check(Term_Spaw_1),       True)
        self.assertEqual(self.checker.check(Term_Spaw_2),       True)
        
    def test_Sync_Term_Term(self):
        self.assertEqual(self.checker.check(Term_Term_1),       True)
        self.assertEqual(self.checker.check(Term_Term_2),       True)
        self.assertEqual(self.checker.check(Term_Term_3),       True)
        
    def test_Sync_Term_Norm(self):
        self.assertEqual(self.checker.check(Term_Norm_1),       True)
        self.assertEqual(self.checker.check(Term_Norm_2),       True)
        
    def test_Sync_Norm_Mono(self):
        self.assertEqual(self.checker.check(Norm_Mono_1),       True)
        self.assertEqual(self.checker.check(Norm_Mono_2),       True)
        
    def test_Sync_Norm_Spwn(self):
        self.assertEqual(self.checker.check(Norm_Spaw_1),       True)
        self.assertEqual(self.checker.check(Norm_Spaw_2),       True)
        
    def test_Sync_Norm_Term(self):
        self.assertEqual(self.checker.check(Norm_Term_1),       True)
        self.assertEqual(self.checker.check(Norm_Term_2),       True)
        
    def test_Sync_Norm_Norm(self):
        self.assertEqual(self.checker.check(Norm_Norm_1),       True)
        self.assertEqual(self.checker.check(Norm_Norm_2),       True)
        self.assertEqual(self.checker.check(Norm_Norm_3),       True)
    
    def test_Sync_Specials(self):
        self.assertEqual(self.checker.check(Rec1),              True)
        self.assertEqual(self.checker.check(Rec2),              True)
        self.assertEqual(self.checker.check(s1),                True)
        self.assertEqual(self.checker.check(PrivateSync),       True)
        self.assertEqual(self.checker.check(RptExample),        True)
        self.assertEqual(self.checker.check(pingpong),          True)



suit = []
suit.append(unittest.TestLoader().loadTestsFromTestCase(TestNetTranslator))

alltests = unittest.TestSuite(suit)
unittest.TextTestRunner(verbosity=0).run(alltests)